﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DoAnB
{
    public partial class frmChuyenBan : Form
    {
        public string bandachuyen { get; set; }
        public frmChuyenBan()
        {
            InitializeComponent();
           
            
            DataTable dt = new DataTable();
            dt.Columns.Add("BanID", typeof(string));
            foreach (ListViewItem i in Main.listBanAnStatic.Groups[1].Items)
            {
                dt.Rows.Add(i.Text);
            }
            cbbDenBan.DataSource = dt;
            cbbDenBan.DisplayMember = "BanID";
            this.Text = "Chuyển '" + Main.banguitoisubform.ToString() + "'";
            //label2.Text = "Chuyển " + Main.banguitoisubform.ToLower() + " tới:";
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            foreach(DataRow var in Main.datatbTam.Rows)
            {
                if (var[0].ToString() == Main.banguitoisubform)
                    var[0] = cbbDenBan.Text;
            }
            bandachuyen = cbbDenBan.Text;
            DialogResult = DialogResult.OK;
        }

        private void btnHuy_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
